package com.ruoyi.gigi.sign.domain;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import java.time.LocalDateTime;

/**
 * 考勤管理对象 sign_in
 *
 * @author gigi
 * @date 2024-01-30
 */
@ContentRowHeight(30)  // 设置内容行高
@HeadRowHeight(30) // 设置头行高
@ColumnWidth(32) // 设置列宽
@ContentFontStyle(fontHeightInPoints = 18, color = 9, bold = true) // 设置内容字体样式
@HeadFontStyle(fontHeightInPoints = 18, color = 9, fontName = "Calibri") // 设置头字体样式
@ContentStyle(horizontalAlignment = HorizontalAlignment.LEFT, fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 30
        , borderBottom = BorderStyle.NONE, borderTop = BorderStyle.NONE, borderLeft = BorderStyle.NONE, borderRight = BorderStyle.NONE)
// 设置内容对其方式，背景颜色
@HeadStyle(horizontalAlignment = HorizontalAlignment.LEFT, fillPatternType = FillPatternType.SOLID_FOREGROUND, fillForegroundColor = 30
        , borderBottom = BorderStyle.NONE, borderTop = BorderStyle.NONE, borderLeft = BorderStyle.NONE, borderRight = BorderStyle.NONE)
// 设置头对其方式，背景颜色
@ExcelIgnoreUnannotated
public class SignIn extends BaseEntity {
    private static final long serialVersionUID = 1L;

    public String getTypeDesc() {
        return typeDesc;
    }

    public void setTypeDesc(String typeDesc) {
        this.typeDesc = typeDesc;
    }

    /**
     * 主键id
     */
    private Long id;

    /**
     * 签到方式（0口令 1拍照 2位置 3手势）
     */

    private Integer type;

    @ExcelProperty(value = "签到方式", index = 6)
    private String typeDesc;

    public String getStartTimeStr() {
        return startTimeStr;
    }

    public void setStartTimeStr(String startTimeStr) {
        this.startTimeStr = startTimeStr;
    }

    public String getEndTimeStr() {
        return endTimeStr;
    }

    public void setEndTimeStr(String endTimeStr) {
        this.endTimeStr = endTimeStr;
    }

    /**
     * 课程id
     */
    
    private Long courseId;

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    @ExcelProperty(value = "班级", index = 1)
    private String className;

    /**
     * 用户id（老师id）
     */
    
    private Long userId;

    /**
     * 口令
     */
    
    private Long pwd;

    /**
     * 经纬度
     */
    
    @Excel(name = "经纬度")
    private String location;

    /**
     * 发布教师
     */
    @ExcelProperty(value = "发起教师", index = 2)
    private String userName;

    @ExcelProperty(value = "发起时间", index = 4)
    private String startTimeStr;

    @ExcelProperty(value = "截止时间", index = 5)
    private String endTimeStr;

    @ExcelProperty(value = "工号", index = 3)
    private Long userNo;

    public Long getUserNo() {
        return userNo;
    }

    public void setUserNo(Long userNo) {
        this.userNo = userNo;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    /**
     * 课程名
     */
    @ExcelProperty(value = "课程", index = 0)
    private String courseName;

    /**
     * 状态（0进行中 1已结束）
     */
    
    private Integer state;

    /**
     * 开始时间
     */
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime endTime;

    /**
     * 范围
     */
    
    private String locationRange;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getType() {
        return type;
    }

    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }

    public Long getCourseId() {
        return courseId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setPwd(Long pwd) {
        this.pwd = pwd;
    }

    public Long getPwd() {
        return pwd;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    public String getLocation() {
        return location;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getState() {
        return state;
    }

    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }

    public LocalDateTime getStartTime() {
        return startTime;
    }

    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }

    public LocalDateTime getEndTime() {
        return endTime;
    }

    public void setLocationRange(String locationRange) {
        this.locationRange = locationRange;
    }

    public String getLocationRange() {
        return locationRange;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("type", getType())
                .append("courseId", getCourseId())
                .append("userId", getUserId())
                .append("pwd", getPwd())
                .append("location", getLocation())
                .append("state", getState())
                .append("startTime", getStartTime())
                .append("endTime", getEndTime())
                .append("locationRange", getLocationRange())
                .append("userName", getUserName())
                .append("courseName", getCourseName())
                .append("userNo", getUserNo())
                .append("typeDesc", getTypeDesc())
                .append("className", getClassName())
                .append("startTimeStr", getStartTimeStr())
                .append("endTimeStr", getEndTimeStr())
                .toString();
    }
}
